package com.controller;


<<<<<<< HEAD
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.entity.ResumeSkillExperience;
import com.entity.ResumeStudyExperience;
import com.entity.ResumeWorkExperience;
import com.service.ResumeSkillExperienceService;
import com.service.ResumeWorkExperienceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.thymeleaf.util.StringUtils;

import java.util.List;
=======
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
>>>>>>> 784072f6c3135fcc1cd41893f32c7972e4abb8b2

/**
 * <p>
 * 简历-工作经历表 前端控制器
 * </p>
 *
 * @author Damon
 * @since 2021-04-26
 */
@RestController
@RequestMapping("/resume-work-experience")
<<<<<<< HEAD
@Api(value = "UsersController", tags = {"工作经历接口"})

public class ResumeWorkExperienceController {
    @Autowired
    private ResumeWorkExperienceService resumeWorkExperienceService;
    @RequestMapping("/listAll")
    @ApiOperation(value = "查询工作经历信息listAll", notes = "查询工作经历信息", httpMethod = "POST")
    public List<ResumeWorkExperience> listAll(){
        List<ResumeWorkExperience> list = resumeWorkExperienceService.list();
        return list;
    }


    @GetMapping("/list")
    @ApiOperation(value = "根据账户工作信息list", notes = "查询工作经历信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "简历表ID", required = true, dataType = "string"),
    })
    public List<ResumeWorkExperience> list(String resumeid){
        QueryWrapper<ResumeWorkExperience> sql = new QueryWrapper<ResumeWorkExperience>();
        sql.lambda()
                .like(!StringUtils.isEmpty(resumeid),ResumeWorkExperience::getResumeid,resumeid);
        List<ResumeWorkExperience> list = this.resumeWorkExperienceService.list(sql);
        return list;
    }


    //支持新增或修改  Post提交  /emp/edit
    @RequestMapping("/edit")
    @PostMapping("/edit")
    @ApiOperation(value = "更改工作信息edit", notes = "编辑工作信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
            @ApiImplicitParam(name = "modify", value = "0为增1为改", required = true, dataType = "string"),
    })
    public boolean edit(@RequestBody ResumeWorkExperience resumeWorkExperience){

        boolean res=false;
        if("0".equals(resumeWorkExperience.getModify())){
            //新增
            res = resumeWorkExperienceService.save(resumeWorkExperience);
        }else{
            //修改
            res = resumeWorkExperienceService.updateById(resumeWorkExperience);
        }
        return res;
    }

    @RequestMapping("/getById")
    @GetMapping("/getById")
    @ApiOperation(value = "查询工作信息getById", notes = "编辑工作信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
            @ApiImplicitParam(name = "modify", value = "0为增1为改", required = true, dataType = "string"),
    })
    public ResumeWorkExperience getById(int id){
        return resumeWorkExperienceService.getById(id);
    }

    @RequestMapping("/del")
    @GetMapping("/del")
    @ApiOperation(value = "删除工作信息del", notes = "删除工作信息", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "resumeid", value = "专家Id", required = true, dataType = "string"),
    })
    public boolean del(ResumeWorkExperience resumeWorkExperience){
        return resumeWorkExperienceService.removeById(resumeWorkExperience.getId());
    }
=======
public class ResumeWorkExperienceController {

>>>>>>> 784072f6c3135fcc1cd41893f32c7972e4abb8b2
}

